Report post

What are HTML comments?

The HTML comments are used to indicate sections of a document or insert notes explaining the code. They help understand the code and increase its readability. The comment tag can also be used for excluding temporary code blocks instead of deleting them. For defining HTML comments we use the tag.

Why are there no attributes available for the comments tag?

It is simply a means to provide developers with a way to comment their code without it being rendered on the page. Therefore, there are no attributes available for the comments tag.

What is the purpose of the comments tag?

It tells the browser the code is commented and should not be rendered on the page. The comments tag is very useful when you need to leave some backup code on the page and do not want to render it. It is also useful to make some notes to remind yourself during your build process.

What is commenting out?

Commenting out is when you temporarily “deactivate” a piece of working code with a comment. Commenting out has two main purposes. The first is debugging: Upon discovering an error, you can “deactivate” different parts of your code with comments, check if the error is still occurring, and repeat the process until the buggy code is found.

Related articles

The World's Leading Crypto Trading Platform

Get my welcome gifts